﻿#define _CRT_SECURE_NO_WARNINGS 1

#include"n.h"


void menu()
{
	printf("**************************************\n");
	printf("**************************************\n");
	printf("*****  1.add         2.del      ******\n");
	printf("*****  3.search      4.modify   ******\n");
	printf("*****  5.printf      0.exi      ******\n");
	printf("**************************************\n");
	printf("**************************************\n");
}


void test()
{
	int input = 0;
	Contact con;
	InitialContact(&con);
	do
	{
		menu();
		printf("请选择:>\n");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			AddContact(&con);
			break;
		case 2:
			DelContact(&con);
			break;
		case 3:
			SearchContact(&con);
			break;
		case 4:
			ModifyContact(&con);
			break;
		case 5:
			PrintContact(&con);
			break;
		case 0:
			printf("退出通讯录\n");
			break;
		default:
			printf("输入错误\n");
			break;
		}
	} while (input);
}

int main()
{
	test();

}